package com.lei.wiki.controller;

import com.lei.wiki.domain.Demo;
import com.lei.wiki.service.DemoService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Lei Tao
 */
@RestController
@RequestMapping("demo")
public class DemoController {

    private final DemoService demoService;

    public DemoController(DemoService demoService) {
        this.demoService = demoService;
    }

    @GetMapping("/list")
    public List<Demo> list() {
        return demoService.list();
    }
}
